1. Field of the Invention
The invention relates to a noise filter, particularly to a dynamic noise filter.
2. Description of the Related Art
FIG. 1A shows a characteristic curve of a temporal noise reduction (TNR) filter in the prior art. FIG. 1B shows the relationship of continuous fields versus a temporal axis.
Noise reduction of image data is generally realizes through averaging likely correlated pixels. Referring to FIGS. 1A and 1B, for example, among interlaced fields sequentially arranged in a temporal axis, the TNR filter compares the luminance of one single pixel (assuming a pixel pixel(cur, i, j) at the coordinate (i,j) of the current field, called “cur field”) with the luminance of the pixel pixel(pre2, i, j) at the same coordinate (i,j) of the second preceding field (called “pre2 field”). If the absolute value of luminance difference (diff=abs(pixel(cur,i,j)−pixel(pre2, i,j))) is less than th1, the pixel at the coordinate (i,j) is treated to be static and the difference diff is assumed to be caused by noise (assuming noise is low amplitude). If diff is more than th2, the pixel at the coordinate (i,j) is treated to be in motion. After the pixel pixel(cur, i, j) is provided to the TNR filter, the corresponding output value of the TNR filter is as follows:pixel(cur,i,j)=pixel(cur,i,j)×alpha+pixel(pre2,i,j)×(1−alpha)  (1).
It should be noted that throughout the specification i is defined as a row index in an image (for example, a field or a frame) and j is defined as a column index.
Although the TNR filter has obvious noise reduction effect on static images, it has the following disadvantages for motion images. When the amount of movement of an object is relatively small between continuous images, the relative positions related to the object edge in the cur field and in the pre2 field are shown in FIG. 2A. FIG. 2B shows the absolute luminance differences between the cur field and the pre2 field in FIG. 2A. FIG. 2C shows a result after the characteristic curve of FIG. 1A is applied to the absolute luminance differences of FIG. 2B. As can be observed from FIGS. 2A˜2C, when the amount of movement of the object is relatively small between continuous images, there is a trailing effect on the moving object after the characteristic curve in FIG. 1A is applied.
When the amount of movement of an object is relatively large between images, the relative positions related to the object edge in the cur field and in the pre2 field are shown in FIG. 3A. FIG. 3B shows the absolute luminance differences between the cur field and the pre2 field in FIG. 3A. FIG. 3C shows a result after the characteristic curve in FIG. 1A is applied to the absolute luminance differences of FIG. 3B. As can be observed from FIGS. 3A˜3C, when the amount of movement of the object is relatively large between images, there is a ringing effect on the moving object after the characteristic curve in FIG. 1A is applied.
FIG. 4A shows a moving object in the pre2 field that has been processed by the TNR filter. FIG. 4B shows the same moving object as that of FIG. 4A in the cur field which is not processed by the TNR filter, where the dotted line represents the position of the object in the pre2 field and the solid line represents the position of the object in the cur field. Since the cur field of FIG. 4B is not processed by the TNR filter, there is a lot of noise in the background of the object. FIG. 4C shows the cur field that is processed by the conventional TNR filter. It can be seen from FIG. 4C that the noise background generates a shadow or trailing effect on the moving object.
A conventional noise filter is generally a combination of a TNR filter and a spatial noise reduction (SNR) filter. In general, parameters of a TNR filter and a SNR filter in the prior art are fixed once they are set. However, in practice, image contents are quite complicated; for example, there are different noise levels, different amounts of movement for different object, or different values of luminance difference between its objects and its backgrounds for each field. Accordingly, no matter which filter (a TNR filter or a SNR filter) is applied, one single preset characteristic curve or a set of parameters is insufficient to cover all the image contents, thereby lowering the image quality.
On the other hand, a conventional sigma filter calculates the average of the pixels having the luminance differences or the chrominance difference within a specific range and excludes the pixels having the luminance differences or the chrominance differences out of the specific range. For the example shown in FIG. 5A, assuming that a parameter ppdiff (referring to a definition of equation (8)) is the maximum absolute luminance difference in a block and a parameter factor is a preset value, a parameter R(=ppdiff×factor) is a range of luminance differences set by the system. According to the prior art, the sigma filter treats the luminance ya of a target pixel pixel(cur, i, j) as a criterion and calculates the average of the pixels having the luminance in the range of (ya−R) to (ya+R). For example, the pixels pixel(cur, i, j+2) and pixel(cur, i, j+3) will not be included in calculating the average since their luminance is too large. FIG. 5B shows the relation between an actual luminance difference R_diff(y,x) and a modified luminance difference m_diff(y,x) according to a conventional sigma filter. As shown in FIG. 5B, when the actual luminance difference R_diff(y,x)=(pixel(cur, y, x)−pixel(cur, i, j)) between a target pixel (i,j) (at the coordinate (i,j)) and an adjacent pixel (y,x) (y≠i and x≠j) is more than +R or less than −R, its corresponding modified luminance difference m_diff(y,x) equals 0 (that is, the slope slope2=∞). In other words, the pixel pixel(cur, y, x) will be excluded from average calculation by the sigma filter in the prior art.
Take a 1×5 (m=1 (number of rows) and n=5 (number of columns)) block for example. Assuming that factor-0.25 and the luminance of five pixels in the 1×5 block is 100, 51, 25, 0, and 5 (e.g., the middle pixel having the luminance value of 25 is the target pixel), according to the relation shown in FIG. 5B, R=(100−0)×0.25=25 and thus an output value out (=25+(0+0−25−20)/4=14) related to the target pixel is obtained at the output of the sigma filter. Assuming that there is some noise in the 1×5 block, the luminance of the five pixels becomes 104, 50, 25, 0, and 5, sequentially. According to the relation shown in FIG. 5B, R=(104−0)×0.25=26 and thus an output value out′ (=25+(0+25−25−20)/4=20) related to the target pixel is obtained at the output of the sigma filter. From the above example, when there is some noise in the 1×5 block, a luminance difference of six grey levels (from 14 to 20) is produced at the output of the sigma filter according to the slope slope2=∞ in FIG. 5B and the target pixel, thereby rendering the output image quality unstable.